package com.cavin.controller;

import com.cavin.bean.User;
import com.cavin.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Chrui
 * @date 2018/10/25__15:44
 */

@Controller
@RequestMapping("/user")
public class UserHandler {
    @Autowired
    UserMapper userMapper;

    @RequestMapping(value = "/login.action", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
    public @ResponseBody
    User Login(User user) {
        System.out.println(user);
        User newUser=userMapper.checkUser(user).get(0);
        System.out.println(newUser);
        return user;
    }


}
